package cn.itcast;

import cn.itcast.filter.AccessTokenFilter;
import cn.itcast.filter.PreZuulFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;

/**
 * @Author: zhaojie
 * @Date: Created in 14:23 2018/7/27
 * @Description: 启用 zuul需要使用@EnableZuulProxy注解
 */
@SpringBootApplication
@EnableZuulProxy
public class GatewayZuulApplication {
    public static void main(String[] args) {
        SpringApplication.run(GatewayZuulApplication.class,args);
    }

    @Bean
    public PreZuulFilter preZuulFilter(){
        return new PreZuulFilter();
    }

    @Bean
    public AccessTokenFilter accessTokenFilter(){return new AccessTokenFilter();}
}
